<template>
  <div class="header" ref="headerHeight">
    <router-link to="/">
      <div class="iconfont header-back">&#xe624;</div>
    </router-link>
    城市选择
  </div>
</template>

<script>
export default {
  name: 'CityHeader',
  mounted () {
    // console.log(this.$refs.headerHeight.offsetHeight) // 获取元素的高度
    this.$emit('height', this.$refs.headerHeight.offsetHeight)
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/varibles.styl'
  .header
    position relative
    overflow hidden
    height $headerHeight
    line-height $headerHeight
    text-align center
    color #fff
    background $bgColor
    font-size .32rem
    .header-back
      position absolute
      top 0
      left 0
      width .64rem
      text-align center
      font-size .36rem
      color #fff
</style>
